package com.lxs.gitee001.model;

import com.fasterxml.jackson.annotation.JsonProperty;

public class response {
    /**
     * Token响应数据类
     */
    public static class TokenResponse {
        @JsonProperty("access_token")
        private String accessToken;

        @JsonProperty("token_type")
        private String tokenType;

        @JsonProperty("expires_in")
        private int expiresIn;

        @JsonProperty("refresh_token")
        private String refreshToken;

        private String scope;

        @JsonProperty("created_at")
        private long createdAt;

        // 无参构造函数
        public TokenResponse() {}

        // getters and setters
        public String getAccessToken() { return accessToken; }
        public void setAccessToken(String accessToken) { this.accessToken = accessToken; }

        public String getTokenType() { return tokenType; }
        public void setTokenType(String tokenType) { this.tokenType = tokenType; }

        public int getExpiresIn() { return expiresIn; }
        public void setExpiresIn(int expiresIn) { this.expiresIn = expiresIn; }

        public String getRefreshToken() { return refreshToken; }
        public void setRefreshToken(String refreshToken) { this.refreshToken = refreshToken; }

        public String getScope() { return scope; }
        public void setScope(String scope) { this.scope = scope; }

        public long getCreatedAt() { return createdAt; }
        public void setCreatedAt(long createdAt) { this.createdAt = createdAt; }

    //    @Override
    //    public String toString() {
    //        return "TokenResponse{" +
    //                "accessToken='" + (accessToken != null ? accessToken.substring(0, 10) + "..." : "null") + '\'' +
    //                ", tokenType='" + tokenType + '\'' +
    //                ", expiresIn=" + expiresIn +
    //                ", refreshToken='" + (refreshToken != null ? refreshToken.substring(0, 10) + "..." : "null") + '\'' +
    //                ", scope='" + scope + '\'' +
    //                ", createdAt=" + createdAt +
    //                '}';
    //    }


        @Override
        public String toString() {
            return "TokenResponse{" +
                    "accessToken='" + accessToken + '\'' +
                    ", tokenType='" + tokenType + '\'' +
                    ", expiresIn=" + expiresIn +
                    ", refreshToken='" + refreshToken + '\'' +
                    ", scope='" + scope + '\'' +
                    ", createdAt=" + createdAt +
                    '}';
        }
    }
}
